package io.aicn.lowcode.generator.model;

import lombok.Data;

@Data
public class ColumnInfo {
    private String name;
    private String type;
    private Integer length;
    private Integer precision;
    private Integer scale;
    private Boolean nullable;
    private String defaultValue;
    private String comment;
    private Boolean autoIncrement;
    private Boolean primaryKey;
    private Boolean unique;
    private String javaType;
    private String javaProperty;
    
    // 新增字段：支持基础数据类型定义
    private String dataType; // 引用base/data-types.schema.json中的数据类型
    private String connectEntity; // 引用base/connect-entity.schema.json中的外键关系
    
    // 扩展字段：支持更多数据类型属性
    private String charset; // 字符集
    private String collation; // 排序规则
    private Boolean unsigned; // 是否无符号（数值类型）
    private Boolean zerofill; // 是否零填充（数值类型）
    private String enumValues; // 枚举值（枚举类型）
    
    // 手动添加getter方法以解决编译问题
    public String getName() {
        return name;
    }
    
    public String getComment() {
        return comment;
    }
    
    public String getJavaType() {
        return javaType;
    }
    
    public String getJavaProperty() {
        return javaProperty;
    }
    
    public Integer getLength() {
        return length;
    }
    
    public Boolean getNullable() {
        return nullable;
    }
    
    public Boolean getPrimaryKey() {
        return primaryKey;
    }
    
    public String getType() {
        return type;
    }
    
    public void setJavaProperty(String javaProperty) {
        this.javaProperty = javaProperty;
    }
    
    public void setPrimaryKey(Boolean primaryKey) {
        this.primaryKey = primaryKey;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public void setLength(Integer length) {
        this.length = length;
    }
    
    public void setPrecision(Integer precision) {
        this.precision = precision;
    }
    
    public void setScale(Integer scale) {
        this.scale = scale;
    }
    
    public void setNullable(Boolean nullable) {
        this.nullable = nullable;
    }
    
    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }
    
    public void setComment(String comment) {
        this.comment = comment;
    }
    
    public void setAutoIncrement(Boolean autoIncrement) {
        this.autoIncrement = autoIncrement;
    }
    
    public void setUnique(Boolean unique) {
        this.unique = unique;
    }
    
    public void setJavaType(String javaType) {
        this.javaType = javaType;
    }

    public Boolean getAutoIncrement() {
        return autoIncrement;
    }
    
    private String arrayElementType; // 数组元素类型（数组类型）
}